Biostatistics on TeX

% XeLaTeX can use any Mac OS X font. See the setromanfont command below.
% Input to XeLaTeX is full Unicode, so Unicode characters can be typed directly into the source.

% The next lines tell TeXShop to typeset with xelatex, and to open and save the source with Unicode encoding.

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

% WARNING!  Do not type any of the following 10 characters except as directed:
%                &   $   #   %   _   {   }   ^   ~   \   

\documentclass[12pt]{article}
\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.
\geometry{a4paper}                   % ... or a4paper or a5paper or ... 
%\geometry{landscape}                % Activate for for rotated page geometry
%\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}

\usepackage{latexsym,bm}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{color}

% Will Robertson's fontspec.sty can be used to simplify font choices.
% To experiment, open /Applications/Font Book to examine the fonts provided on Mac OS X,
% and change "Hoefler Text" to any of these choices.

%\setromanfont[Mapping=tex-text]{Hoefler Text}       % use it if mainly english in the text
\setromanfont{Kai}     % use it if mainly chinese in the text
%\setromanfont{Hei}     % use it if mainly chinese in the text

\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}
\setmonofont[Scale=MatchLowercase]{Andale Mono}

 \newfontfamily{\L}[Scale=0.9]{Lucida Grande}
 \newfontfamily{\S}[Scale=0.85]{STSong}
 \newfontfamily{\H}[Scale=0.85]{Hei}

\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt

\linespread{1.36}
\parindent=0pt

\title{生物统计学第四次习题课内容补充与纠正}
\author{Augix}
\date{\today}                                           % Activate to display a given date or no date

\begin{document}
\maketitle


\section{补充证明: $ cov(X, X) = DX $}          % This command makes a section title.

证:根据协方差的定义:
$ cov(X, Y)  = E[(X-EX)(Y-EY)] $,于是,
\begin{eqnarray*}
cov(X, X) & = & E[(X-EX)(X-EX)]\\
                 & = & E[(X^2 - 2XEX+(EX)^2]\\
                 & = & E(X^2) -2 EXEX + (EX)^2]\\
                 & = & E(X^2) - (EX)^2
\end{eqnarray*}

又,$ DX = E(X^2) - (EX)^2 $ (课本78页),所以,$ cov(X, X) = DX $,证毕.

另外,相关系数
\begin{eqnarray*}
\rho_{XX} &=& \frac{cov(x,x)}{\sqrt{DX} \sqrt{DX}}\\
                  &=& \frac{DX}{DX}\\
                  &=& 1
\end{eqnarray*}

\newpage

\section{纠正:课本93页第22题}
解:首先考察变量的取值范围,
因为,$ 0 < x < 1$, $|y|<x$,\\
所以$x, y$的取值范围如Figure 1所示,每一对$(x,y)$都落在红色区域内.
 
 % Put graphics
\begin{figure}[h]
  \begin{center}
    \caption{$X, Y$的取值范围}\label{fig:DS}
    \includegraphics[scale=0.5]{figure1.png}
  \end{center}
\end{figure}


这里方便起见,首先证明$X, Y$不独立. 也就是证明 $ p(x,y) \neq p(x) p(y) $(课本56页).\\
\\
首先看$p(x)$,对于某一确定值$x$,$p(x)$是$X$在$x$这一点的概率密度,那么对于这一定值$x$,$Y$的取值范围是限定在$(-x,x)$的,于是$p(x)=\int_{-x}^x p(x,y) dy = \int_{-x}^x dy = 2x$. 那么,
%\begin{equation*}
$p(x) = 
\begin{cases} 2x, & 0<x<1 \\0, & \text{其他.}
\end{cases}
$
%\end{equation*}
\\
至于为何求$X$的边缘分布密度时要对$Y$作积分,可以用全概率公式理解(课本21页). 可以把$X$的取值理解为事件$B$,$Y$的取值理解为事件$A$.\\
\\
然后对于$Y$的边缘分布密度,就是在$(-1,1)$中对于任一确定值$y$求$p(y)$,这个时候$Y$是固定的,\textcolor{red}{$X$的取值范围并不是$(0,1)$,而是$(|y|,1)$,这是需要纠正的地方}. 于是$ p(y) = \int_{|y|}^1 dx = 1 - |y| $. 那么,
%\begin{equation*}
$p(y) = 
\begin{cases} 1-|y|, & -1<y<1 \\0, & \text{其他.}
\end{cases}
$
%\end{equation*}
\\
因此,
\begin{eqnarray*}
p(x) p(y) & = & 2x (1-|y|)\\
p(x,y) & = & 1 \text{(题干)}\\
p(x,y) & \neq & p(x) p(y)
\end{eqnarray*}
所以,$X, Y$不独立. \\
\\
第二部分证明$X, Y$不相关. 只需证明$cov(X, Y) = 0$.
\begin{eqnarray*}
cov(X,Y) &=& E[(X-EX)(Y-EY)]\\
         &=& E[XY - XEY -YEX + EXEY]\\
         &=& E(XY) - EXEY -EYEX + EXEY\\
         &=& E(XY) - EXEY
\end{eqnarray*}

根据求解出的概率密度函数$p(x), p(y)$,有
\begin{eqnarray*}
E(X) & = & \int_{-\infty}^{+\infty} x p(x) dx = \int_0^1 2 x^2 dx = \left.\frac{2}{3} x^3 \right|_0^1 = \frac{2}{3}\\
E(Y) & = & \int_{-\infty}^{+\infty} y p(y) dy = \int_{-1}^1 y(1-|y|) dy
\end{eqnarray*}


其实,$1-|y|$ 是偶函数,$y(1-|y|)$ 是奇函数,所以 $E(Y) = 0$.\\
如果要细致地化解,那么,
\begin{eqnarray*}
E(Y) &=& \int_{-1}^0 y (1+y) dy + \int_{0}^1 y (1-y) dy\\
     &=& \int_{-1}^0 (y+y^2) dy + \int_{0}^1 (y-y^2) dy\\
     &=& \left.\frac{1}{2} y^2 \right|_{-1}^0 + \left.\frac{2}{3} y^3 \right|_{-1}^0 + \left.\frac{1}{2} y^2 \right|_{0}^1 - \left.\frac{2}{3} y^3 \right|_0^1\\
     &=& -\frac{1}{2} +\frac{2}{3} +\frac{1}{2} -\frac{2}{3}\\
     &=& 0
\end{eqnarray*}

\newpage

至于$E(XY)$,参考课本75页定理(关于Z的数学期望,定理的证明超出课程范围),有
\begin{eqnarray*}
E(XY) &=& \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} xy dxdy\\
      &=& \int_0^1 \int_{-x}^x xy dxdy\\
      &=& \int_0^1 dx \left.\left(\frac{1}{2}x y^2 \right) \right|_{y=-x}^{y=x}\\
      &=& 0
\end{eqnarray*}
所以,$cov(X,Y) = E(XY) - EXEY = 0 - 0 = 0$,X 和 Y 不相关.

另外,也可根据以下公式求解 X 和 Y 的协方差(课本83页).\\
$cov(x,y) = \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} (x-EX) (y-EY) p(x,y) dxdy.$\\
\\
实际上对于红色区域内的任意一点$(x,y)$,$p(x,y)$都等于1,是均匀的,试想我们把数字$X$均匀地放在红色区域内,那么当我们沿着横坐标从0向1移动时,我们看到的样本点是越来越多的,而且这些样本点上面的数字也越来越大. 当我们把平面内的数字$X$都拿掉,把数字Y放上去时,从-1到1移动,我们看到的样本点先变多,然后变少,我们看到最多的是0,然后镜面对称的正值和负值看到的次数一样多. 最后,我们也可以把$X$和$Y$的乘积均匀放在红色区域内,不难推测,其实乘积的期望也将是0.\\
\\



\end{document} 
Homepage
Comments

Hide Comments